<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>大蟒阵营</title>

    <!-- 网站图标 -->
    <link rel="icon" type="image/x-icon" href="/statics/img/favicon.ico">

    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <style type="text/css">
        .site-icon { padding: 5px 10px 0 10px; }
    </style>
    {% block ext_css %}{% endblock %}
</head>

<body>
    <!-- Navbar -->
    <nav class="navbar navbar-inverse navbar-static-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand site-icon" href="/">
                    <img src="/statics/img/icon.png" width="40px" height="40px">
                </a>
                <a class="navbar-brand" href="/">大蟒阵营</a>
            </div>

            <ul class="nav navbar-nav navbar-right">
                <li><a href="/post/create/">发表新帖</a></li>
                {% if "uid" in request.session %}
                    <li><a  href="/user/info/">Hello, {{request.session.nickname}}</a></li>
                    <li>
                        <a class="navbar-brand" href="/user/info/">
                            <img src="{{request.session.avatar}}" height="25px" width="25px">
                        </a>
                    </li>
                    <li><a href="/user/logout/">退出</a></li>
                {% else %}
                    <li><a href="/user/register/">注册</a></li>
                    <li><a href="/user/login/">登陆</a></li>
                {% endif %}
            </ul>
        </div>
    </nav>

    <div class="container">
        <div class="col-md-8">{% block container %}{% endblock %}</div>
        <div class="col-md-4">
            <div class="well">
                <form class="form-horizontal" action="/post/search/" method="POST">
                    {% csrf_token %}
                    <input type="text" class="form-control" placeholder="搜索" name="keyword">
                </form>

                <hr>
                <h4>热门文章</h4>
                <iframe src="/post/top10/" frameborder="0" id="iFrame1" name="iFrame1"
                        onload="this.height=iFrame1.document.body.scrollHeight">
                    <p>Your browser does not support iframes.</p>
                </iframe>
            </div>
        </div>
    </div>

    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    {% block ext_js %}{% endblock %}
</body>
</html>
